package meihua.stopcarapp.presenter;

import android.util.Log;

import meihua.mylibrary.baserx.RxSubscriber;
import meihua.stopcarapp.R;
import meihua.stopcarapp.bean.result.MyWalletResult;
import meihua.stopcarapp.presenter.contract.MyWalletContract;

/**
 * Name: LGZ
 * Time: 2017/5/18.
 * Dec:
 */

public class MyWalletPresenter extends MyWalletContract.Presenter {
    @Override
    public void getMyWalletListRequest(String user_id) {
        mRxManage.add(mModel.getMyWallet(user_id)
                .subscribe(new RxSubscriber<MyWalletResult>(mContext,false) {
                    @Override
                    public void onStart() {
                        super.onStart();
                        mView.showLoading(mContext.getString(R.string.loading));
                    }
                    @Override
                    protected void _onNext(MyWalletResult myWallet) {
                        mView.returnMyWalletList(myWallet);
                        mView.stopLoading();
                    }
                    @Override
                    protected void _onError(String message) {
                        Log.d("ligaozeng","服务器错误:"+message);
                    }
                }));
    }
}
